<script src="${basepath}/plugin/ueditor-min-1.4.3/ueditor.config.js"></script>
<script src="${basepath}/plugin/ueditor-min-1.4.3/ueditor.all.min.js?v=0"> </script>
<%var jstpl = {%>
<script>
    var form = layui.form;
    var ue = UE.getEditor('desc', { zIndex: 199});
    //监听提交
    form.on('submit(formDemo)', function(data) {
        Ajax("/system/notice/savePlacard", data.field, function(d) {
            if(d.state == true) {
                window.location.href="/system/notice/placard";
            } else {
                gx.alert(d.msg);
            }
        })
    });
</script>

<%};%>

<%var csstpl = {%>

<%};%>

<%var title={%>${placard.id==null?'添加公告':'修改公告'}
<%};%>
<%layout("../layout/_layout_layui.html",{title:title,jstpl:jstpl,csstpl:csstpl}){ %>
<section id="content">
    <form class="layui-form form-horizontal">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form" wid100="">

                    <input type="hidden" name="placard.id" value="${placard.id!} ">

                    <div class="layui-form-item">
                        <label class="layui-form-label">公告标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="placard.title"  value="${placard.title!}" placeholder="请输入公告标题" class="layui-input" lay-verify="required" />
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">公告类型</label>
                        <div class="layui-input-block">
                            <select class="layui-input" name="placard.type_id" lay-verify="required" >
                                <option value="">请选择公告类型</option>
                                <%for(t in type_list!){%>
                                <option  value="${t.id!}" ${placard.type_id==t.id?'selected':''}  >${t.type_name!}</option>
                                <%}%>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            <input type="checkbox"   value="0" ${placard.state!0==0?'checked':''}  name="placard.state"   lay-skin="switch" lay-text="正常|禁用">
                        </div>
                    </div>

                    <div class="layui-form-item" >
                        <label class="layui-form-label">内容</label>
                        <div class="layui-input-block">
                            <textarea rows="" id="desc" cols="3" name="placard.context" lay-verify="required" >${placard.context!}</textarea>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="button" class="layui-btn" lay-submit="" lay-filter="formDemo">${placard.id==null?'提交':'保存'}</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>

<%}%>